#ifndef XVIDEOWIDGET_H
#define XVIDEOWIDGET_H
#include <QDebug>
#include <QWidget>
#include <QOpenGLWidget>
#include <QOpenGLFunctions>
#include <QOpenGLShaderProgram>
#include <QTimer>
class XVideoWidget : public QOpenGLWidget, protected  QOpenGLFunctions
{
    Q_OBJECT
public:
    explicit XVideoWidget(QWidget *parent = nullptr);

protected:
    virtual void initializeGL();
    virtual void resizeGL(int w, int h);
    virtual void paintGL();

private:
    // shader 程序
    QOpenGLShaderProgram program;

    // shader 中yuv 变量地址
    GLuint unis[3] = {0};

    // opengl 的 texture 地址
    GLuint texs[3] = {0};

    // 材质内存空间
    unsigned char *datas[3] = {0};

    int width = 240;
    int height = 128;
signals:

};

#endif // XVIDEOWIDGET_H
